package com.ilop.permission.adapter;

import android.content.Context;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.databinding.ViewDataBinding;
import androidx.recyclerview.widget.DiffUtil.ItemCallback;

/**
 * @author skygge@yeah.net
 * @date 2022/11/29.
 */
public abstract class SimpleDataBindingAdapter<M, B extends ViewDataBinding> extends DataBindingAdapter<M, B> {

    private final int layout;

    public SimpleDataBindingAdapter(Context context, int layout, @NonNull ItemCallback<M> diffCallback) {
        super(context, diffCallback);
        this.layout = layout;
    }

    @LayoutRes
    protected int getLayoutResId(int viewType) {
        return this.layout;
    }
}

